package Mooc.Chap1;

import java.util.Scanner;

public class _01基础 {
    public static void main(String[] args) {
        //1.1输入输出
//        System.out.println("Hello World!你好");
//        Scanner in=new Scanner(System.in);
//        System.out.println("echo:"+in.nextLine());
//        System.out.println("2+3+"+5);
//        System.out.println(2+3+"=2+3+"+(2+3));

        //1.2变量
//        int price;
//        Scanner input = new Scanner(System.in);
//        price=input.nextInt();
//        System.out.println("100-"+price+'='+(100-price));

        //1.3赋值
//        int price,amount;
//        final int a=100;//定义常量
//        Scanner input = new Scanner(System.in);
//        System.out.print("请输入price:");
//        price=input.nextInt();
//        System.out.print("请输入amount:");
//        amount=input.nextInt();
//        System.out.print("price-amount=");
//        System.out.println(price+"-"+amount+"="+(price-amount));

        //1.4浮点数\类型转换
        int foot;
        double inch;
        Scanner input = new Scanner(System.in);
        System.out.print("请输入尺寸:");
        foot = input.nextInt();
        inch = input.nextDouble();//可以用inch = input.nextInt();
        System.out.println((foot + inch / 12) * 0.3048+"m");//或者除以12.0
        System.out.println((int)((foot + inch / 12) * 0.3048*100)+"cm");
    }
}
